@(signupForm: Form[models.core.user.LocalCredentialDtoImpl])(createForm: Form[models.core.user.UserDto])
@import helper._
@import controllers.facebook._
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#">
<body>
	
	<div id="fb-root"></div>     
 	<script>
        window.fbAsyncInit = function() {
          FB.init({
            appId      : '@FacebookManager.getAppId()', // App ID
            status     : true, // check login status
            cookie     : true, // enable cookies to allow the server to access the session
            xfbml      : true  // parse XFBML
          });
        };
        // Load the SDK Asynchronously
        (function(d){
           var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
           if (d.getElementById(id)) {return;}
           js = d.createElement('script'); js.id = id; js.async = true;
           js.src = "//connect.facebook.net/en_US/all.js";
           ref.parentNode.insertBefore(js, ref);
         }(document));
      </script>
        
   <script type="text/javascript">
    function login() {
        // get current login status from facebook.com
        FB.getLoginStatus(function(response) {
            if (response.status === 'connected') {
              // the user is logged in and connected to your app
                window.location = "@routes.Authentication.facebook()";
            } else {
              window.location = "@routes.Authentication.cancel()";
            }
         });
    }
    </script>

    <fb:login-button onlogin="login();" scope="email,user_birthday,read_stream,publish_stream"></fb:login-button>
	
    <div id="user">
		@helper.form(action = routes.Authentication.login) {
	
			<fieldset>
            <legend>Account informations</legend>
            
            @inputText(
                signupForm("login"), 
                '_label -> "Login", 
                '_help -> "Please choose a valid username.",
                '_error -> signupForm.globalError
            )
            
            
            @inputPassword(
                signupForm("password"), 
                '_label -> "Password",
                '_help -> "A password must be at least 6 characters. "
            )
            
                
        </fieldset>
        
        <div class="actions">
            <input type="submit" class="btn primary" value="Sign Up">
            <a href="@routes.Authentication.cancel">Cancel</a>
        </div>
  
		}
	</div>
	<div id="create">
		@helper.form(action = routes.Authentication.create) {
	
			<fieldset>
            <legend>Create an Account</legend>
            
            @inputText(
                createForm("login"), 
                '_label -> "Login", 
                '_help -> "Please choose a valid username.",
                '_error -> signupForm.globalError
            )
            
            
            @inputPassword(
                createForm("password"), 
                '_label -> "Password",
                '_help -> "A password must be at least 6 characters. "
            )

			@inputPassword(
                createForm("repassword"), 
                '_label -> "Re password",
                '_help -> "Same as password. "
            )
            
			@inputText(
                createForm("email"), 
                '_label -> "Email",
                '_help -> "A email must be a valid email. "
            )

			@inputText(
                createForm("gender"), 
                '_label -> "Gender",
                '_help -> "Your first name. "
            )

			@inputText(
                createForm("firstName"), 
                '_label -> "First Name",
                '_help -> "Your first name. "
            )

			@inputText(
                createForm("lastName"), 
                '_label -> "Last Name",
                '_help -> "Your last Nnme. "
            )

			@inputText(
                createForm("birthday"), 
                '_label -> "Birth day",
                '_help -> "Birth day. "
            )
                
        </fieldset>
        
        <div class="actions">
            <input type="submit" class="btn primary" value="Create">
            <a href="@routes.Authentication.cancel">Cancel</a>
        </div>
	}
	</div>

</body>